package com.framework.main.sys.indexFream.dao;

import java.util.List;

import com.framework.base.dao.BaseDao;

/**
 * @Title: IndexFreamDao.java
 * @Package com.framework.main.sys.indexFream
 * @Description:首页框架数据层.用来获取待办公文，通知公告，文件交流以及统计三项的总数数据操作
 * @jdk version 1.6
 * @author lzl
 * @date 2011-11-21 下午05:07:21
 * @version V1.0
 */

public class IndexFreamDao extends BaseDao {

	/**
	 * @Title: getDoDocuments
	 * @Description: 获取待办公文列表
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public List<?> getDoDocuments(String sql) throws Exception {
		return this.getSqlMapClientTemplate().queryForList(
				this.getNameSpace() + "getDoDocuments", sql);
	}

	/**
	 * @Title: getAnnouncement
	 * @Description: 获取通知公告列表
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public List<?> getAnnouncement(String sql) throws Exception {
		return this.getSqlMapClientTemplate().queryForList(
				this.getNameSpace() + "getAnnouncement", sql);
	}

	/**
	 * @Title: getReceiverNoReader
	 * @Description: 获取文件交流列表
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public List<?> getReceiverNoReader(String userId) throws Exception {
		return this.getSqlMapClientTemplate().queryForList(
				this.getNameSpace() + "doQueryReceiverNoReader", userId);
	}

	/**
	 * @Title: countDocuments
	 * @Description: 统计待办公文条数
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public int countDocuments(String sql) throws Exception {
		Object object = this.getSqlMapClientTemplate().queryForObject(
				this.getNameSpace() + "getDoDocumentsCount", sql);
		return ((Integer) object).intValue();
	}

	/**
	 * @Title: getAnnouncementCount
	 * @Description: 统计通知公告总数
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public int getAnnouncementCount(String sql) throws Exception {
		Object object = this.getSqlMapClientTemplate().queryForObject(
				this.getNameSpace() + "getAnnouncementCount", sql);
		return ((Integer) object).intValue();
	}

	/**
	 * @Title: getReceiverNoReaderCount
	 * @Description: 统计文件交流未读总数
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public int getReceiverNoReaderCount(String userId) throws Exception {
		Object object = this.getSqlMapClientTemplate().queryForObject(
				this.getNameSpace() + "getReceiverNoReaderCount", userId);
		return ((Integer) object).intValue();
	}

	/**
	 * @Title: getPerScherdule
	 * @Description: 获取今天明天的日程安排
	 * 
	 * 
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public List<?> getPerScherdule(String sql) throws Exception {
		return this.getSqlMapClientTemplate().queryForList(
				this.getNameSpace() + "getPerScherdule", sql);
	}

	/**
	 * @Title: getPerScherduleD
	 * @Description: 获取今天的日程
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public Object getPerScherduleD(String sql) throws Exception {
		return this.getSqlMapClientTemplate().queryForObject(
				this.getNameSpace() + "getPerScherdule", sql);
	}

	/**
	 * @Title: getTopPreSCherdule
	 * @Description: 桌面日程列表
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public List<?> getTopPreSCherdule(String sql) throws Exception {
		return this.getSqlMapClientTemplate().queryForList(
				this.getNameSpace() + "getTopPreSCherdule", sql);
	}
}
